package com.study.mapper;

import com.study.domain.Comment;
import org.apache.ibatis.annotations.*;

@Mapper
public interface CommentMapper {
    @Select("select * from t_comment where id=#{id}")
    public Comment findById(int id);

    @Insert("insert into t_comment(content,author,a_id) values (#{content},#{author},#{aId})")
    public int insertComment(Comment comment);

    @Update("update t_comment set content=#{content} where id=#{id}")
    public int updateComment(Comment comment);

    @Delete("delete from t_comment where id=#{id}")
    public int deleteComment(int id);

    //删除作者
    @Delete("delete from t_comment where author=#{author}")
    public int deleteComment2(String author);


    

}
